home *** CD-ROM | disk | FTP | other *** search
/ MacPeople 1998 #2 / MACPEOPLE-1998-NO2.ISO / アップル関連 / ARA PS アップデート / モデム用 / OMRON ME2814B3 ARA2 / OMRON ME2814B3 ARA2 next >
Text File  |  1996-04-20  |  14KB  |  714 lines

  1. !**************************************************************************
  2. !    OMRON ME2814B3 ARA Ver2.0 JAPAN
  3. !    1996/04/20 Ver1.0
  4. !    Written by OMRON Corp.  
  5. !
  6. !  'mlts' resource info for this modem:
  7. !    byte 1 == 01 -> modem HAS builtin reliability protocols
  8. !    byte 2 == 00 -> reserved by Apple
  9. !    byte 3 == 23 -> max hex chars in varstr 7 (35 dec)
  10. !    byte 4 == 23 -> max hex chars in varstr 8
  11. !    byte 5 == 23 -> max hex chars in varstr 9
  12. !    
  13. !**************************************************************************
  14. @ORIGINATE
  15. @ANSWER
  16. !------------------------
  17. ! reset the serial port
  18. !------------------------
  19. HSReset 0 0 0 0 0 0  
  20. @LABEL 1
  21. DTRClear
  22. pause 10
  23. DTRSet
  24. pause 3
  25. ! Mac talks to the modem at 28,800 bps.
  26. serreset 19200, 0, 8, 1
  27. setspeed 38400
  28. matchclr
  29. settries 0
  30. ! Modem initialize ATZ
  31. @LABEL 2
  32. matchclr
  33. matchstr 1 3 "OK¥13¥10"
  34. matchstr 2 3 "0¥13"
  35. write "ATZ¥13"
  36. matchread 15
  37. inctries
  38. iftries 3 3
  39. jump 2
  40. ! Modem Setting
  41. ! E0  - Command Echo Off
  42. ! Q0  - Command Response On
  43. ! V1  - Command Response Format Word
  44. ! M1  - Speaker Moniter on until carrier detected
  45. ! &C1 - Carrier Signal Detect Carrier from the remote modem 
  46. ! &D2 - Data Terminal Ready Control On to Off on-hook
  47. ! &S1 - Activates DSR before handshaking
  48. ! &B1 - DTE Speed Setting 19200bps
  49. ! &A3 - Result Error Corection Type
  50. ! &M0 - Error Colection V.42-Off & MNP-Off
  51. ! &H1&R1&I0 - CTS Hardware flow Control
  52. ! S0=0 - Don't answer calls
  53. @LABEL 3
  54. matchclr
  55. matchstr 1 4 "OK¥13¥10"
  56. pause 2
  57. write "ATE0Q0V1M1&C1&D2&S1X4&B1&A0&M0&H1&R1&I0S0=0¥13"
  58. matchread 15
  59. inctries
  60. iftries 3 105
  61. jump 3
  62. !-----------------------------------------
  63. ! Modem responding & configured.
  64. ! determine if reliable link is requested.
  65. !-----------------------------------------
  66. @LABEL 4
  67. ! if modem mnp10 link requested (var 4 == 2) then jump label 5
  68. ifstr 4 5 "2"
  69. !
  70. ! if modem v42 link requested (var 4 == 1) then jump label 6
  71. ifstr 4 6 "1"
  72. !
  73. ! if no modem v42 link requested (var 4 == 0) [same as ARA 1.0] then jump label 9
  74. ifstr 4 8 "0"
  75. !
  76. ! else invalid value in var 4; exit w/error
  77. jump 110
  78. !--------------------------------
  79. ! MNP10 Link Setting.
  80. !--------------------------------
  81. @LABEL 5
  82. matchclr
  83. matchstr 1 7 "OK¥13¥10"
  84. ! S15=128 - V.42-Off
  85. ! &M4 - MNP-On
  86. ! &K0 - DATACOMP-Off
  87. pause 2
  88. write "AT&M4&K0&A3S15=128¥13"
  89. matchread 15
  90. inctries
  91. iftries 3 105
  92. jump 5
  93. !-----------------------------------------------------
  94. ! V.42 Link Setting V.42 --> MNP --> Normal
  95. !-----------------------------------------------------
  96. @LABEL 6
  97. matchclr
  98. matchstr 1 7 "OK¥13¥10"
  99. ! &M4S - v42 autoreliable mode
  100. pause 2
  101. write "AT&M4&K0&A3S15=8¥13"
  102. matchread 15
  103. inctries
  104. iftries 3 105
  105. jump 6
  106. !------------------------------------------------------------------------
  107. ! If we DID support compression in the modem, this is where it would go.
  108. !------------------------------------------------------------------------
  109. @LABEL 7
  110. !
  111. !
  112. !
  113. !------------------------------------------------------------------------
  114. ! Set ID OMRON MD2814B3.
  115. !------------------------------------------------------------------------
  116. @LABEL 8
  117. matchclr
  118. matchstr 1 9 "3362¥13¥10¥13¥10OK¥13¥10"
  119. pause 2
  120. write "ATI0¥13"
  121. matchread 15
  122. inctries
  123. iftries 3 105
  124. jump 8
  125. !--------------------------------------------------------------------------
  126. ! If speaker on flag is true, jump to label 13.  Else turn off the speaker.
  127. !--------------------------------------------------------------------------
  128. @LABEL 9
  129. ifstr 2 13 "1"
  130. pause 5
  131. matchclr
  132. matchstr 1 13 "OK¥13¥10"
  133. pause 2
  134. write "ATM0¥13"
  135. matchread 15
  136. inctries
  137. iftries 3 105
  138. jump 9
  139. !*******************************************************************************
  140. ! modem ready, so enable answering or originate a call - label range is 11-30
  141. !
  142. !
  143. !*******************************************************************************
  144. @LABEL 13
  145. pause 5
  146. ifANSWER 100
  147. !
  148. ! if normal dialing (parm 6 == 0) jump to 19
  149. ifstr 6 19 "0"
  150. !
  151. ! if blind dialing (parm 6 == 1) jump to 17
  152. ifstr 6 17 "1"
  153. !
  154. ! if manual dialing (parm 6 == 2) jump to 15 
  155. ifstr 6 15 "2"
  156. !
  157. ! else invalid value in var 6; exit w/error
  158. jump 110
  159. !
  160. !
  161. !
  162. @LABEL 15
  163. note "手動で発信をしています。" 3
  164. ! X1 to ignore dialtone & busy for manual dialing, D to dial
  165. write "ATX1D ¥13"
  166. jump 32
  167. !
  168. !
  169. !
  170. @LABEL 17
  171. matchclr
  172. matchstr 1 19 "OK¥13¥10"
  173. ! X3 to ignore dialtone for blind dialing
  174. pause 2
  175. write "ATX3¥13"
  176. matchread 30
  177. inctries
  178. iftries 3 105
  179. jump 17
  180. !
  181. !
  182. !
  183. @LABEL 19
  184. ! this is where we break up long dialstrings
  185. !
  186. ! parm 1 is always the full dialstring from the conn doc
  187. !note "Dialing ^1" 3
  188. note "^1に電話をしています。" 3
  189. ! parm 3 is always "p" for pulse & "t" for tone
  190. !
  191. ! if parm 8 == blank (complete dialstring in parm 7)
  192. !  then jump to label 27 & dial parm 7
  193. ifstr 8 27 " "
  194. !
  195. ! if parm 9 == blank (complete dialstring in parms 7 & 8)
  196. !  then jump to label 24 & dial parm 7 & 8
  197. ifstr 9 24 " "
  198. !
  199. !  else dial parm 7 & 8 & 9 (complete dialstring in parms 7, 8 & 9)
  200. matchclr
  201. matchstr 1 21 "OK¥13¥10"
  202. ! parm 7 holds first string fragment
  203. write "ATD^3^7;¥13"
  204. matchread 500
  205. ! modem not responding; bailout.
  206. jump 105
  207. !
  208. !
  209. !
  210. @LABEL 21
  211. ! parm 8 holds second string fragment
  212. matchclr
  213. matchstr 1 22 "OK¥13¥10"
  214. write "ATD^3^8;¥13"
  215. matchread 500
  216. ! modem not responding; bailout.
  217. jump 105
  218. !
  219. !
  220. !
  221. @LABEL 22
  222. ! parm 9 holds last string fragment
  223. write "ATD^3^9¥13"
  224. jump 32
  225. !
  226. !
  227. !
  228. !
  229. @LABEL 24
  230. matchclr
  231. matchstr 1 25 "OK¥13¥10"
  232. ! parm 7 holds first string fragment
  233. write "ATD^3^7;¥13"
  234. matchread 500
  235. ! modem not responding; bailout.
  236. jump 105
  237. !
  238. !
  239. !
  240. @LABEL 25
  241. ! parm 8 holds last string fragment
  242. write "ATD^3^8¥13"
  243. jump 32
  244. !
  245. !
  246. !
  247. @LABEL 27
  248. ! parm 7 holds entire string
  249. write "ATD^3^7¥13"
  250. jump 32
  251. !***********************************************
  252. !    connecting - label range is 34-99
  253. !
  254. !
  255. !***********************************************
  256. @LABEL 32
  257. matchclr
  258. !
  259. matchstr 1  34 "CONNECT 1200¥13¥10"
  260. matchstr 2  34 "CONNECT 1200/NONE¥13¥10"
  261. matchstr 3  35 "CONNECT 1200/ARQ"
  262. !
  263. matchstr 4  38 "CONNECT 2400¥13¥10"
  264. matchstr 5  38 "CONNECT 2400/NONE¥13¥10"
  265. matchstr 6  39 "CONNECT 2400/ARQ"
  266. !
  267. matchstr 7  42 "CONNECT 4800¥13¥10"
  268. matchstr 8  42 "CONNECT 4800/V"
  269. matchstr 9  43 "CONNECT 4800/ARQ"
  270. !
  271. matchstr 10 46 "CONNECT 7200¥13¥10"
  272. matchstr 11 46 "CONNECT 7200/V"
  273. matchstr 12 47 "CONNECT 7200/ARQ"
  274. !
  275. matchstr 13 50 "CONNECT 9600¥13¥10"
  276. matchstr 14 50 "CONNECT 9600/V"
  277. matchstr 15 51 "CONNECT 9600/ARQ"
  278. !
  279. matchstr 16 54 "CONNECT 12000¥13¥10"
  280. matchstr 17 54 "CONNECT 12000/V"
  281. matchstr 18 55 "CONNECT 12000/ARQ"
  282. !
  283. matchstr 19 58 "CONNECT 14400¥13¥10"
  284. matchstr 20 58 "CONNECT 14400/V"
  285. matchstr 21 59 "CONNECT 14400/ARQ"
  286. !
  287. matchstr 22 62 "CONNECT 16800¥13¥10"
  288. matchstr 23 62 "CONNECT 16800/V"
  289. matchstr 24 63 "CONNECT 16800/ARQ"
  290. !
  291. matchstr 25 66 "CONNECT 19200¥13¥10"
  292. matchstr 26 66 "CONNECT 19200/V"
  293. matchstr 27 67 "CONNECT 19200/ARQ"
  294. !
  295. matchstr 28 70 "CONNECT 21600¥13¥10"
  296. matchstr 29 70 "CONNECT 21600/V"
  297. matchstr 30 71 "CONNECT 21600/ARQ"
  298. !
  299. matchstr 31 74 "CONNECT 24000¥13¥10"
  300. matchstr 32 74 "CONNECT 24000/V"
  301. matchstr 33 75 "CONNECT 24000/ARQ"
  302. !
  303. matchstr 34 78 "CONNECT 26400¥13¥10"
  304. matchstr 35 78 "CONNECT 26400/V"
  305. matchstr 36 79 "CONNECT 26400/ARQ"
  306. !
  307. matchstr 37 82 "CONNECT 28800¥13¥10"
  308. matchstr 38 82 "CONNECT 28800/V"
  309. matchstr 39 83 "CONNECT 28800/ARQ"
  310. !
  311. ! other result codes.
  312. !
  313. matchstr 40 101 "RING¥13¥10"
  314. matchstr 41 106 "NO DIAL TONE¥13¥10"
  315. matchstr 42 107 "NO CARRIER¥13¥10"
  316. matchstr 43 107 "ERROR¥13¥10"
  317. matchstr 44 108 "BUSY¥13¥10"
  318. matchstr 45 111 "CONNECT¥13¥10"
  319. !
  320. matchread 700
  321. jump 32
  322. ifANSWER 32
  323. jump 105
  324. !------------------------------------------------------------
  325. !  THIS v32b modem has been setup to do cts handshaking,
  326. !  and we assume that a cts handshaking cable is being used,
  327. !  so we leave the serial port set to 19,200 bps.
  328. !------------------------------------------------------------
  329. @LABEL 34
  330. note "1200bpsで接続確認中" 3
  331. CommunicatingAt 1200
  332. jump 90
  333. !
  334. @LABEL 35
  335. note "1200bps-MNPで接続確認中" 3
  336. CommunicatingAt 1200
  337. jump 90
  338. !
  339. @LABEL 36
  340. note "1200bps-MNP10で接続確認中" 3
  341. CommunicatingAt 1200
  342. jump 90
  343. !
  344. @LABEL 37
  345. note "1200bps-V.42で接続確認中" 3
  346. CommunicatingAt 1200
  347. jump 90
  348. !
  349. !
  350. !
  351. @LABEL 38
  352. note "2400bpsで接続確認中" 3
  353. CommunicatingAt 2400
  354. jump 90
  355. !
  356. @LABEL 39
  357. note "2400bps-MNPで接続確認中" 3
  358. CommunicatingAt 2400
  359. jump 90
  360. !
  361. @LABEL 40
  362. note "2400bps-MNP10で接続確認中" 3
  363. CommunicatingAt 2400
  364. jump 90
  365. !
  366. @LABEL 41
  367. note "2400bps-V.42で接続確認中" 3
  368. CommunicatingAt 2400
  369. jump 90
  370. !
  371. !
  372. !
  373. @LABEL 42
  374. note "4800bpsで接続確認中" 3
  375. CommunicatingAt 4800
  376. jump 90
  377. !
  378. @LABEL 43
  379. note "4800bps-MNPで接続確認中" 3
  380. CommunicatingAt 4800
  381. jump 90
  382. !
  383. @LABEL 44
  384. note "4800bps-MNP10で接続確認中" 3
  385. CommunicatingAt 4800
  386. jump 90
  387. !
  388. @LABEL 45
  389. note "4800bps-V.42で接続確認中" 3
  390. CommunicatingAt 4800
  391. jump 90
  392. !
  393. !
  394. !
  395. @LABEL 46
  396. note "7200bpsで接続確認中" 3
  397. CommunicatingAt 7200
  398. jump 90
  399. !
  400. @LABEL 47
  401. note "7200bps-MNPで接続確認中" 3
  402. CommunicatingAt 7200
  403. jump 90
  404. !
  405. @LABEL 48
  406. note "7200bps-MNP10で接続確認中" 3
  407. CommunicatingAt 7200
  408. jump 90
  409. !
  410. @LABEL 49
  411. note "7200bps-V.42で接続確認中" 3
  412. CommunicatingAt 7200
  413. jump 90
  414. !
  415. !
  416. !
  417. @LABEL 50
  418. note "9600bpsで接続確認中" 3
  419. CommunicatingAt 9600
  420. jump 90
  421. !
  422. @LABEL 51
  423. note "9600bps-MNPで接続確認中" 3
  424. CommunicatingAt 9600
  425. jump 90
  426. !
  427. @LABEL 52
  428. note "9600bps-MNP10で接続確認中" 3
  429. CommunicatingAt 9600
  430. jump 90
  431. !
  432. @LABEL 53
  433. note "9600bps-V.42で接続確認中" 3
  434. CommunicatingAt 9600
  435. jump 90
  436. !
  437. !
  438. !
  439. @LABEL 54
  440. note "12000bpsで接続確認中" 3
  441. CommunicatingAt 12000
  442. jump 90
  443. !
  444. @LABEL 55
  445. note "12000bps-MNPで接続確認中" 3
  446. CommunicatingAt 12000
  447. jump 90
  448. !
  449. @LABEL 56
  450. note "12000bps-MNP10で接続確認中" 3
  451. CommunicatingAt 12000
  452. jump 90
  453. !
  454. @LABEL 57
  455. note "12000bps-V.42で接続確認中" 3
  456. CommunicatingAt 12000
  457. jump 90
  458. !
  459. !
  460. !
  461. @LABEL 58
  462. note "14400bpsで接続確認中" 3
  463. CommunicatingAt 14400
  464. jump 90
  465. !
  466. @LABEL 59
  467. note "14400bps-MNPで接続確認中" 3
  468. CommunicatingAt 14400
  469. jump 90
  470. !
  471. @LABEL 60
  472. note "14400bps-MNP10で接続確認中" 3
  473. CommunicatingAt 14400
  474. jump 90
  475. !
  476. @LABEL 61
  477. note "14400bps-V.42で接続確認中" 3
  478. CommunicatingAt 14400
  479. jump 90
  480. !
  481. @LABEL 62
  482. note "16800bpsで接続確認中" 3
  483. CommunicatingAt 16800
  484. jump 90
  485. !
  486. @LABEL 63
  487. note "16800bps-MNPで接続確認中" 3
  488. CommunicatingAt 16800
  489. jump 90
  490. !
  491. @LABEL 65
  492. note "16800bps-V.42で接続確認中" 3
  493. CommunicatingAt 16800
  494. jump 90
  495. !
  496. !
  497. !
  498. @LABEL 66
  499. note "19200bpsで接続確認中" 3
  500. CommunicatingAt 19200
  501. jump 90
  502. !
  503. @LABEL 67
  504. note "19200bps-MNPで接続確認中" 3
  505. CommunicatingAt 19200
  506. jump 90
  507. !
  508. @LABEL 69
  509. note "19200bps-V.42で接続確認中" 3
  510. CommunicatingAt 19200
  511. jump 90
  512. !
  513. !
  514. !
  515. @LABEL 70
  516. note "21600bpsで接続確認中" 3
  517. CommunicatingAt 21600
  518. jump 90
  519. !
  520. @LABEL 71
  521. note "21600bps-MNPで接続確認中" 3
  522. CommunicatingAt 21600
  523. jump 90
  524. !
  525. @LABEL 73
  526. note "21600bps-V.42で接続確認中" 3
  527. CommunicatingAt 21600
  528. jump 90
  529. !
  530. !
  531. !
  532. @LABEL 74
  533. note "24000bpsで接続確認中" 3
  534. CommunicatingAt 24000
  535. jump 90
  536. !
  537. @LABEL 75
  538. note "24000bps-MNPで接続確認中" 3
  539. CommunicatingAt 24000
  540. jump 90
  541. !
  542. @LABEL 77
  543. note "24000bps-V.42で接続確認中" 3
  544. CommunicatingAt 24000
  545. jump 90
  546. !
  547. !
  548. !
  549. @LABEL 78
  550. note "26400bpsで接続確認中" 3
  551. CommunicatingAt 26400
  552. jump 90
  553. !
  554. @LABEL 79
  555. note "26400bps-MNPで接続確認中" 3
  556. CommunicatingAt 26400
  557. jump 90
  558. !
  559. @LABEL 81
  560. note "26400bps-V.42で接続確認中" 3
  561. CommunicatingAt 26400
  562. jump 90
  563. !
  564. !
  565. !
  566. @LABEL 82
  567. note "28800bpsで接続確認中" 3
  568. CommunicatingAt 28800
  569. jump 90
  570. !
  571. @LABEL 83
  572. note "28800bps-MNPで接続確認中" 3
  573. CommunicatingAt 28800
  574. jump 90
  575. !
  576. @LABEL 85
  577. note "28800bps-V.42で接続確認中" 3
  578. CommunicatingAt 28800
  579. jump 90
  580. !
  581. !
  582. !
  583. @LABEL 90
  584. ! turn on cts handshaking.
  585. HSReset 0 1 0 0 0 0
  586. !
  587. pause 30
  588. ifANSWER 91
  589. pause 15
  590. @LABEL 91
  591. exit 0
  592. !************************************************************
  593. ! @ANSWER
  594. ! Set the modem to answer on 1st ring - label range is 100-104
  595. !
  596. !************************************************************
  597. @LABEL 100
  598. matchclr
  599. matchstr 1 32 "OK¥13¥10"
  600. pause 2
  601. write "ATS0=2¥13"
  602. matchread 30
  603. inctries
  604. iftries 3 105
  605. jump 100
  606. !
  607. @LABEL 101
  608. ifORIGINATE 32
  609. ! claim the serial port
  610. userhook 1
  611. note "電話がかかってきました。" 2
  612. jump 32
  613. !************************************************
  614. ! error messages - label range is 105-114
  615. !
  616. !
  617. !************************************************
  618. ! Modem Not Responding
  619. @LABEL 105
  620. exit -6019
  621. !
  622. ! No Dial Tone
  623. @LABEL 106
  624. note "電話回線が接続されていない。または、0発信をしている場合はダイヤルトーン検出無視にして下さい" 3
  625. exit -6020
  626. !
  627. ! No Carrier or Error
  628. @LABEL 107
  629. exit -6021
  630. !
  631. ! Busy
  632. @LABEL 108
  633. exit -6022
  634. !
  635. ! No Answer
  636. @LABEL 109
  637. exit -6023
  638. !
  639. ! varstring invalid value
  640. @LABEL 110
  641. exit -6027
  642. !
  643. ! Connect 300bps
  644. @LABEL 111
  645. exit -6002 "ARA doesn't support 300bps connection."
  646. !
  647. !********************************************
  648. ! Hang up the modem - label range is 115-120
  649. !
  650. !
  651. !********************************************
  652. @HANGUP
  653. @LABEL 115
  654. settries 0
  655. HSReset 0 0 0 0 0 0
  656. @LABEL 116
  657. !----------------------------
  658. ! firstly try escape sequence
  659. !----------------------------
  660. serreset 19200, 0, 8, 1
  661. setspeed 38400
  662. matchclr
  663. matchstr 1 117 "OK¥13¥10"
  664. pause 10
  665. write "+++"
  666. matchread 15
  667. !
  668. @LABEL 117
  669. !-------------------
  670. ! secondly try ATH
  671. !-------------------
  672. matchclr
  673. matchstr 1 119 "NO CARRIER¥13¥10"
  674. matchstr 2 119 "OK¥13¥10"
  675. matchstr 3 119 "ERROR¥13¥10"
  676. write "ATH¥13"
  677. matchread 50
  678. inctries
  679. iftries 3 118
  680. jump 117
  681. !---------------------------------------
  682. ! finaly try On-to-Off DTR transitions
  683. !---------------------------------------
  684. @LABEL 118
  685. DTRSet
  686. pause 5
  687. DTRClear
  688. pause 5
  689. DTRSet
  690. flush
  691. jump 119
  692. !------------------------------
  693. ! recall the factory settings.
  694. !------------------------------
  695. @LABEL 119
  696. serreset 19200, 0, 8, 1
  697. setspeed 38400
  698. pause 15
  699. matchclr
  700. matchstr 1 120 "OK¥13¥10"
  701. write "ATS0=0¥13"
  702. matchread 30
  703. inctries
  704. iftries 3 105
  705. jump 119
  706. !
  707. @LABEL 120
  708. exit 0
  709.  
  710. !*********************************************************
  711. ! labels 121-128 are reserved for future emergency hacks
  712. !
  713. !
  714. !*********************************************************